-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for client credentials grant #269
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
============================================
- Coverage 51.45% 48.09% -3.37%
- Complexity 406 434 +28
============================================
Files 30 31 +1
Lines 1028 1100 +72
============================================
Hits 529 529
- Misses 499 571 +72 ☔ View full report in Codecov by Sentry. |
Don't understand create duplicate PR of #257 |
@kuzmany guessing because there has been no response to feedback since September 2021! |
Ok. But still would be good mention what is different between my version and this version. |
Sure thing.
|
@nick-vanpraet could you take a look at the failing tests for this PR please? Appreciate it was a while back, it'd be great to get it tested and merged! @escopecz and @kuzmany we do still need to decide to merge this in favour of the older PR. It seems sensible to do so given the outlined additional functionality. Let's make a decision and get it merged? |
@RCheesley we use #257 for our customers. It's from 2021 then I am not able to say what community need to merge. I see some Dennis comments, but cannot spend more time on it, only for maintenance to push it to branch. It's up to community. As usual I prefer less work for done. |
Tested PR: #269 in my build server and it is working. Just 2x NOTICES need to be fixed:
File:
public function validateAccessToken()
{
$this->log('validateAccessToken()');
//Check to see if token in session has expired
if ( !empty($this->_access_token) && !empty($this->_expires) && $this->_expires < (time() + 10)) {
$this->log('access token expired');
return false;
}
//Check for existing access token
if ( !empty($this->_access_token) ) {
$this->log('has valid access token');
return true;
}
//If there is no existing access token, it can't be valid
return false;
} This is a low risk merge:
I vote to merge and released PR: #269 immediately, as it is a critical missing feature with low-impact. |
@nick-vanpraet looks like there's some code style fixes to be done here, would you take a look please? We also need to have the test coverage increased as you can see from CodeCov. Let us know if you need some help with that! |
PR to replace #257 as that one seems abandoned.
Adds support for the client_credentials grant type added in M4 mautic/mautic#9837
I kept as much of the logic that was used in the Oauth Auth class in as I could (the debugging, the weird query parameter access token thing that I'm pretty sure is a security concern, etc).